<!DOCTYPE html>
<html>
<head>
    <title>OneQuery</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/public/favicon.ico" type="image/x-icon">
    <!-- 引入 Bootstrap -->
    <link href="/public/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">
    <link href="/public/css/index.css" rel="stylesheet">
</head>
<body>
<div id="root">
    <div class="row" v-clock>
        <div class="col-md-4">
            <div class="pin">
                <div class="panel panel-default">
                    <div class="panel-heading text-center">
                        <span class="left" @click="flag=0">OneQuery</span>
                        <div class="btn-group-vertical">
                            <div @click="flag=1">
                                <strong class="text-success">{{env.env}}</strong>
                                <span class="caret"></span>
                            </div>
                            <ul class="dropdown-menu one-select" v-show="flag==1">
                                <li v-for="item in env.envList" @click="changeEnv(item)"><a
                                        href="javascript:;">{{item}}</a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="panel-body">
                        <div class="form-group">
                            <div class="input-group">
                                <input type="text" class="form-control" placeholder="SQL..."
                                       v-model="sql"
                                       @focus="flag=3"
                                >
                                <ul class="dropdown-menu one-select" v-show="flag==3">
                                    <li v-for="(item, index) in cacheSql">
                                        <span @click="deleteSqlItem(index)" class="delete-where btn-danger">&times;</span>
                                        <a href="javascript:;" @click="changeSql(item)">
                                            <span>{{item}}</span>
                                        </a>
                                    </li>
                                </ul>
                                <br>
                                <textarea type="text" rows="3" class="form-control" placeholder="条件..."
                                          v-model="where"
                                          @focus="flag=2"
                                ></textarea>
                                <div class="input-group-addon btn-success" @click="querySqlData">SQL</div>
                                <div class="input-group-addon btn-primary" @click="queryData">条件</div>
                                <ul class="dropdown-menu one-select" v-show="flag==2">
                                    <li v-for="(item, index) in cacheWhere">
                                        <span @click="deleteWhereItem(index)" class="delete-where btn-danger">&times;</span>
                                        <a href="javascript:;" @click="changeWhere(item)">
                                            <span>{{item}}</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    <!--<div class="panel-footer">-->
                    <!--<div class="input-group-addon btn-success" @click="querySqlData">SQL查询</div>-->
                    <!--<div class="input-group-addon btn-primary" @click="queryData">条件查询</div>-->
                    <!--</div>-->
                </div>
                <!-- 风格2 -->
                <!--<div class="form-group">-->
                <!--<div class="input-group">-->
                <!--<div class="btn-group-vertical input-group-addon">-->
                <!--<strong class="text-success">OneQuery</strong>-->
                <!--<span class="caret"></span>-->
                <!--</div>-->
                <!--<input type="text" class="form-control" placeholder="SQL..." v-model="sql">-->
                <!--<br>-->
                <!--<textarea type="text" rows="3" class="form-control" placeholder="条件..."-->
                <!--v-model="where"></textarea>-->
                <!--<div class="input-group-addon btn-success" @click="querySqlData">SQL</div>-->
                <!--<div class="input-group-addon btn-primary" @click="queryData">条件</div>-->
                <!--</div>-->
                <!--</div>-->
                <table-item
                        @table-name="changeTableName"
                        @column-name="changeColumnName"
                        @where-column="changeWhereColumn"
                        ref="table"
                ></table-item>
            </div>
        </div>
        <div class="col-md-8" @click="closeSelect">
            <div class="row" v-for="(tableData, index) in dataArr">
                <data-item :data="tableData"
                           :index="index"
                           @update-where-data="updateWhere"
                           @update-list-data="updateData"
                ></data-item>
            </div>
        </div>
    </div>
</div>

<script src="/public/js/common.js"></script>
<script src="/public/js/vue.min.js"></script>
<script src="/public/js/axios.min.js"></script>
<script src="/public/js/component.js"></script>
<script src="/public/js/index.js"></script>
</body>
</html>